package com.eastseeway.radioproject.retrofit;


import com.eastseeway.radioproject.entities.BaseResponse;
import com.eastseeway.radioproject.entities.BeanDeviceInfo;
import com.eastseeway.radioproject.entities.ElectrodeInfoBean;
import com.eastseeway.radioproject.entities.VersionBean;

import java.util.List;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface ApiService {
    public static final String BASE_URL = "https://api.caiyunapp.com";
//    String HTTP_HOST = " http://yiqi.56ns.cn/";
//    String HTTP_HOST = "http://39.105.25.74:8080/";
    String HTTP_HOST = "http://182.40.198.213:8081/";
//    String PATH = "jeecg-boot/yldevice/queryDeviceVer";
//    String PATH1 = "jeecg-boot/yldevice/updateDeviceVerinfo";
    public static final String TOKEN = "FRiY1SmajnM4X3Cb";

//    通过电极id验证电极
    @GET("jeecg-boot/yldevice/queryConsumableById")
    Call<BaseResponse<ElectrodeInfoBean>> checkElectrode(@Query("deviceid") String deviceid);

//    通过id验证/查询设备
    @GET("jeecg-boot/yldevice/queryDeviceById")
    Call<BaseResponse<BeanDeviceInfo>> checkDevice(@Query("deviceid") String deviceid);
/*
* 下载升级固件
*/
    @GET("jeecg-boot/sys/common/static/{fileName}")
    Call<ResponseBody> downloadFirmware(@Path("fileName")String fileName);

//    上传日志文件
    @POST("jeecg-boot/yldevice/uploadLogFile")
    @Multipart
    Call<BaseResponse> uploadLogFile(@Part MultipartBody.Part filePart, @Part("deviceid") RequestBody deviceid,@Part("remark") RequestBody remark);

//    查询是否需要更新本地软硬件版本
    @GET("jeecg-boot/yldevice/queryDeviceVer")
    Call<BaseResponse<List<VersionBean>>> checkAppUpdate(@Query("deviceid")String deviceId);

//    本地版本更新后上报版本号
    @POST("jeecg-boot/yldevice/updateDeviceVerInfo")
    Call<BaseResponse<String>> uploadVersionInfos(@Query("deviceid")String deviceId,@Query("verinfo")String versionInfo);
}
